package com.xigua._查找;

/**
 * @author LiRongHua
 * @Title: ${file_name}
 * @Package ${package_name}
 * @Description: 统计一个数字在排序数组中出现的次数。
 * @date 2022/3/615:11
 */
public class _剑指_Offer53_I_在排序数组中查找数字I {

    public int search(int[] nums, int target) {
        int ans = 0;
        for (int i = 0; i < nums.length; i++) {
            if (nums[i] == target) ans++;
        }
        return ans;
    }



}
